package com.xxg.fileshand.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xxg.fileshand.R
import com.xxg.fileshand.type.OperateType

/**
 * Create by Sxl on 2021/12/30.
 */
class OperateTypeAdapter : BaseQuickAdapter<OperateType, BaseViewHolder>(R.layout.item_operate_type) , LoadMoreModule {
    override fun convert(helper: BaseViewHolder, item: OperateType) {
        when(item.type) {
            OperateType.OPERATE_TYPE_CHECK.type -> {
                helper.setText(R.id.text1, "档案盘点")
                helper.setImageResource(R.id.iv_image, R.mipmap.ic_dapd)
            }
            OperateType.OPERATE_TYPE_GUIDE.type -> {
                helper.setText(R.id.text1, "上架指导")
                helper.setImageResource(R.id.iv_image, R.mipmap.ic_sjzd)
            }
            OperateType.OPERATE_TYPE_PUT.type -> {
                helper.setText(R.id.text1, "档案上架")
                helper.setImageResource(R.id.iv_image, R.mipmap.ic_dasj)
            }
            OperateType.OPERATE_TYPE_TAKE.type -> {
                helper.setText(R.id.text1, "档案下架")
                helper.setImageResource(R.id.iv_image, R.mipmap.ic_daxj)
            }
            OperateType.OPERATE_TYPE_BORROW.type -> {
                helper.setText(R.id.text1, "档案借阅")
                helper.setImageResource(R.id.iv_image, R.mipmap.ic_dack)
            }
            OperateType.OPERATE_TYPE_RETURN.type -> {
                helper.setText(R.id.text1, "档案归还")
                helper.setImageResource(R.id.iv_image, R.mipmap.ic_dark)
            }
            OperateType.OPERATE_TYPE_REVERSE.type -> {
                helper.setText(R.id.text1, "档案倒架")
                helper.setImageResource(R.id.iv_image, R.mipmap.ic_dadj)
            }
            OperateType.OPERATE_TYPE_SEARCH.type -> {
                helper.setText(R.id.text1, "档案查询")
                helper.setImageResource(R.id.iv_image, R.mipmap.ic_dacx)
            }
            OperateType.OPERATE_TYPE_TEST.type -> {
                helper.setText(R.id.text1, "标签测试")
                helper.setImageResource(R.id.iv_image, R.mipmap.ic_bqcs)
            }
        }

    }
}